<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class DataRPD {

    private $db;
    
    //untuk Lap RPD Harian (dimensi) all level
    private $_kdkanwil;
    private $_nmkanwil;
    private $_kdkppn;
    private $_nmkppn;
    private $_kdsatker;
    private $_nmsatker;
    private $_akun;
    private $_nmakun;
    private $_minggu;
    private $_bulan;
    private $_tahun;
    private $_dom;
    
    //fact/transaksi
    private $_rpd_1;
    private $_rpd_2;
    private $_rpd_3;
    private $_rpd_4;
    private $_rpd_5;
    private $_rpd_6;
    private $_rpd_7;
    private $_rpd_8;
    private $_rpd_9;
    private $_rpd_10;
    private $_rpd_11;
    private $_rpd_12;
    private $_rpd_13;
    private $_rpd_14;
    private $_rpd_15;
    private $_rpd_16;
    private $_rpd_17;
    private $_rpd_18;
    private $_rpd_19;
    private $_rpd_20;
    private $_rpd_21;
    private $_rpd_22;
    private $_rpd_23;
    private $_rpd_24;
    private $_rpd_25;
    private $_rpd_26;
    private $_rpd_27;
    private $_rpd_28;
    private $_rpd_29;
    private $_rpd_30;
    private $_rpd_31;
    private $_sts01;
    private $_sts02;
    private $_sts03;
    private $_sts04;
    private $_sts05;
    private $_sts06;
    private $_sts07;
    private $_sts08;
    private $_sts09;
    private $_sts10;
    private $_sts11;
    private $_sts12;
    private $_sts13;
    private $_sts14;
    private $_sts15;
    private $_sts16;
    private $_sts17;
    private $_sts18;
    private $_sts19;
    private $_sts20;
    private $_sts21;
    private $_sts22;
    private $_sts23;
    private $_sts24;
    private $_sts25;
    private $_sts26;
    private $_sts27;
    private $_sts28;
    private $_sts29;
    private $_sts30;
    private $_sts31;
    
    //global
    private $_table = 'DEVIASI_RPD';
    private $_table1 = 'RPD_PKN_PVT_V';
    
    public $registry;
    
    /*
     * konstruktor
     */

    public function __construct($registry = Registry) {
        $this->db = $registry->db;
        $this->registry = $registry;
    }

    /*
     * mendapatkan data dari tabel Data Tetap
     * @param limit batas default null
     * return array objek Data Tetap */
    
    //contoh..
    public function get_page1($filter) {
        $sql = "select akun, nmakun jenis_belanja, 
                rpd_amount1/1000000 rpd_amount1, actual_amount1/1000000 actual_amount1, case when actual_amount1= 0 and rpd_amount1 <> 0 then 100 when actual_amount1 <> 0 and rpd_amount1 = 0 then 100 else nvl(abs((actual_amount1-rpd_amount1)/nullif(rpd_amount1,0))*100,0) end deviasi1, 
                rpd_amount2/1000000 rpd_amount2, actual_amount2/1000000 actual_amount2, case when actual_amount2= 0 and rpd_amount2 <> 0 then 100 when actual_amount2 <> 0 and rpd_amount2 = 0 then 100 else nvl(abs((actual_amount2-rpd_amount2)/nullif(rpd_amount2,0))*100,0) end deviasi2, 
                rpd_amount3/1000000 rpd_amount3, actual_amount3/1000000 actual_amount3, case when actual_amount3= 0 and rpd_amount3 <> 0 then 100 when actual_amount3 <> 0 and rpd_amount3 = 0 then 100 else nvl(abs((actual_amount3-rpd_amount3)/nullif(rpd_amount3,0))*100,0) end deviasi3, 
                rpd_amount4/1000000 rpd_amount4, actual_amount4/1000000 actual_amount4, case when actual_amount4= 0 and rpd_amount4 <> 0 then 100 when actual_amount4 <> 0 and rpd_amount4 = 0 then 100 else nvl(abs((actual_amount4-rpd_amount4)/nullif(rpd_amount4,0))*100,0) end deviasi4 
from (
                select akun, 'xxx' jenis_belanja, 
                nvl(sum(case when minggu =1 then rpd_amount end),0) rpd_amount1,
                nvl(sum(case when minggu =1 then actual_amount end),0) actual_amount1,
                nvl(sum(case when minggu =2 then rpd_amount end),0) rpd_amount2,
                nvl(sum(case when minggu =2 then actual_amount end),0) actual_amount2,
                nvl(sum(case when minggu =3 then rpd_amount end),0) rpd_amount3,
                nvl(sum(case when minggu =3 then actual_amount end),0) actual_amount3,
                nvl(sum(case when minggu =4 then rpd_amount end),0) rpd_amount4,
                nvl(sum(case when minggu =4 then actual_amount end),0) actual_amount4
                from ".$this->_table."
                where 1=1 ";

        foreach ($filter as $filter) {
            $sql .= " AND " . $filter;
        }
        $sql .= "  group by akun
                order by akun
                ) a
                left join r_jenbel b
                on a.akun = b.kdakun ";
        //var_dump($sql);
        $result = $this->db->select($sql);
        $data = array();
        foreach ($result as $val) {
            $d_data = new $this($this->registry);
            $d_data->set_akun($val['AKUN']);
            $d_data->set_nmakun($val['JENIS_BELANJA']);
            $d_data->set_rpd_1($val['RPD_AMOUNT1']);
            $d_data->set_rpd_2($val['ACTUAL_AMOUNT1']);
            $d_data->set_rpd_3($val['DEVIASI1']);
            $d_data->set_rpd_4($val['RPD_AMOUNT2']);
            $d_data->set_rpd_5($val['ACTUAL_AMOUNT2']);
            $d_data->set_rpd_6($val['DEVIASI2']);
            $d_data->set_rpd_7($val['RPD_AMOUNT3']);
            $d_data->set_rpd_8($val['ACTUAL_AMOUNT3']);
            $d_data->set_rpd_9($val['DEVIASI3']);
            $d_data->set_rpd_10($val['RPD_AMOUNT4']);
            $d_data->set_rpd_11($val['ACTUAL_AMOUNT4']);
            $d_data->set_rpd_12($val['DEVIASI4']);

            $data[] = $d_data;
        }
        return $data;
    }
    
    public function get_page2($filter,$minggu) {
        if ($minggu==1){$tambah_hari = 0;}
        elseif ($minggu==2){$tambah_hari = 7;}
        elseif ($minggu==3){$tambah_hari = 15;}
        elseif ($minggu==4){$tambah_hari = 23;}
        $sql = "select akun, nmakun jenis_belanja, 
                rpd_amount1/1000000 rpd_amount1, actual_amount1/1000000 actual_amount1, 
                case when actual_amount1= 0 and rpd_amount1 <> 0 then 100 when actual_amount1<> 0 and rpd_amount1 = 0 then 100 else nvl(abs((actual_amount1-rpd_amount1)/nullif(rpd_amount1,0))*100,0) end deviasi1, 
                rpd_amount2/1000000 rpd_amount2, actual_amount2/1000000 actual_amount2, 
                case when actual_amount2= 0 and rpd_amount2 <> 0 then 100 when actual_amount2<> 0 and rpd_amount2 = 0 then 100 else nvl(abs((actual_amount2-rpd_amount2)/nullif(rpd_amount2,0))*100,0) end deviasi2, 
                rpd_amount3/1000000 rpd_amount3, actual_amount3/1000000 actual_amount3, 
                case when actual_amount3= 0 and rpd_amount3 <> 0 then 100 when actual_amount3<> 0 and rpd_amount3 = 0 then 100 else nvl(abs((actual_amount3-rpd_amount3)/nullif(rpd_amount3,0))*100,0) end deviasi3, 
                rpd_amount4/1000000 rpd_amount4, actual_amount4/1000000 actual_amount4, 
                case when actual_amount4= 0 and rpd_amount4 <> 0 then 100 when actual_amount4<> 0 and rpd_amount4 = 0 then 100 else nvl(abs((actual_amount4-rpd_amount4)/nullif(rpd_amount4,0))*100,0) end deviasi4, 
                rpd_amount5/1000000 rpd_amount5, actual_amount5/1000000 actual_amount5, 
                case when actual_amount5= 0 and rpd_amount5 <> 0 then 100 when actual_amount5<> 0 and rpd_amount5 = 0 then 100 else nvl(abs((actual_amount5-rpd_amount5)/nullif(rpd_amount5,0))*100,0) end deviasi5, 
                rpd_amount6/1000000 rpd_amount6, actual_amount6/1000000 actual_amount6, 
                case when actual_amount6= 0 and rpd_amount6 <> 0 then 100 when actual_amount6<> 0 and rpd_amount6 = 0 then 100 else nvl(abs((actual_amount6-rpd_amount6)/nullif(rpd_amount6,0))*100,0) end deviasi6, 
                rpd_amount7/1000000 rpd_amount7, actual_amount7/1000000 actual_amount7, 
                case when actual_amount7= 0 and rpd_amount7 <> 0 then 100 when actual_amount7<> 0 and rpd_amount7 = 0 then 100 else nvl(abs((actual_amount7-rpd_amount7)/nullif(rpd_amount7,0))*100,0) end deviasi7, 
                rpd_amount8/1000000 rpd_amount8, actual_amount8/1000000 actual_amount8, 
                case when actual_amount8= 0 and rpd_amount8 <> 0 then 100 when actual_amount8<> 0 and rpd_amount8 = 0 then 100 else nvl(abs((actual_amount8-rpd_amount8)/nullif(rpd_amount8,0))*100,0) end deviasi8 
                from ( select akun, 
                nvl(sum(case when dom= 1+".$tambah_hari." then rpd_amount end),0) rpd_amount1, nvl(sum(case when dom= 1+".$tambah_hari." then actual_amount end),0) actual_amount1, 
                nvl(sum(case when dom= 2+".$tambah_hari." then rpd_amount end),0) rpd_amount2, nvl(sum(case when dom= 2+".$tambah_hari." then actual_amount end),0) actual_amount2, 
                nvl(sum(case when dom= 3+".$tambah_hari." then rpd_amount end),0) rpd_amount3, nvl(sum(case when dom= 3+".$tambah_hari." then actual_amount end),0) actual_amount3, 
                nvl(sum(case when dom= 4+".$tambah_hari." then rpd_amount end),0) rpd_amount4, nvl(sum(case when dom= 4+".$tambah_hari." then actual_amount end),0) actual_amount4, 
                nvl(sum(case when dom= 5+".$tambah_hari." then rpd_amount end),0) rpd_amount5, nvl(sum(case when dom= 5+".$tambah_hari." then actual_amount end),0) actual_amount5, 
                nvl(sum(case when dom= 6+".$tambah_hari." then rpd_amount end),0) rpd_amount6, nvl(sum(case when dom= 6+".$tambah_hari." then actual_amount end),0) actual_amount6, 
                nvl(sum(case when dom= 7+".$tambah_hari." then rpd_amount end),0) rpd_amount7, nvl(sum(case when dom= 7+".$tambah_hari." then actual_amount end),0) actual_amount7, 
                nvl(sum(case when dom= 8+".$tambah_hari." then rpd_amount end),0) rpd_amount8, nvl(sum(case when dom= 8+".$tambah_hari." then actual_amount end),0) actual_amount8  
                from ".$this->_table."
                where 1=1 ";

        foreach ($filter as $filter) {
            $sql .= " AND " . $filter;
        }
        $sql .= "  group by akun
                order by akun
                ) a
                left join r_jenbel b
                on a.akun = b.kdakun ";
        //var_dump($sql);
        $result = $this->db->select($sql);
        $data = array();
        foreach ($result as $val) {
            $d_data = new $this($this->registry);
            $d_data->set_akun($val['AKUN']);
            $d_data->set_nmakun($val['JENIS_BELANJA']);
            $d_data->set_rpd_1($val['RPD_AMOUNT1']);
            $d_data->set_rpd_2($val['ACTUAL_AMOUNT1']);
            $d_data->set_rpd_3($val['DEVIASI1']);
            $d_data->set_rpd_4($val['RPD_AMOUNT2']);
            $d_data->set_rpd_5($val['ACTUAL_AMOUNT2']);
            $d_data->set_rpd_6($val['DEVIASI2']);
            $d_data->set_rpd_7($val['RPD_AMOUNT3']);
            $d_data->set_rpd_8($val['ACTUAL_AMOUNT3']);
            $d_data->set_rpd_9($val['DEVIASI3']);
            $d_data->set_rpd_10($val['RPD_AMOUNT4']);
            $d_data->set_rpd_11($val['ACTUAL_AMOUNT4']);
            $d_data->set_rpd_12($val['DEVIASI4']);
            $d_data->set_rpd_13($val['RPD_AMOUNT5']);
            $d_data->set_rpd_14($val['ACTUAL_AMOUNT5']);
            $d_data->set_rpd_15($val['DEVIASI5']);
            $d_data->set_rpd_16($val['RPD_AMOUNT6']);
            $d_data->set_rpd_17($val['ACTUAL_AMOUNT6']);
            $d_data->set_rpd_18($val['DEVIASI6']);
            $d_data->set_rpd_19($val['RPD_AMOUNT7']);
            $d_data->set_rpd_20($val['ACTUAL_AMOUNT7']);
            $d_data->set_rpd_21($val['DEVIASI7']);
            $d_data->set_rpd_22($val['RPD_AMOUNT8']);
            $d_data->set_rpd_23($val['ACTUAL_AMOUNT8']);
            $d_data->set_rpd_24($val['DEVIASI8']);

            $data[] = $d_data;
        }
        return $data;
    }
    
    public function get_page3($filter) {
        $sql = "select a.kdkppn, nmkppn ,
                rpd_amount1/1000000 rpd_amount1, actual_amount1/1000000 actual_amount1, case when actual_amount1 = 0 and rpd_amount1 <> 0 then 100 when actual_amount1 <> 0 and rpd_amount1 = 0 then 100 else nvl(abs((actual_amount1-rpd_amount1)/nullif(rpd_amount1,0))*100,0) end deviasi1, 
                rpd_amount2/1000000 rpd_amount2, actual_amount2/1000000 actual_amount2, case when actual_amount2 = 0 and rpd_amount2 <> 0 then 100 when actual_amount2 <> 0 and rpd_amount2 = 0 then 100 else nvl(abs((actual_amount2-rpd_amount2)/nullif(rpd_amount2,0))*100,0) end deviasi2, 
                rpd_amount3/1000000 rpd_amount3, actual_amount3/1000000 actual_amount3, case when actual_amount3 = 0 and rpd_amount3 <> 0 then 100 when actual_amount3 <> 0 and rpd_amount3 = 0 then 100 else nvl(abs((actual_amount3-rpd_amount3)/nullif(rpd_amount3,0))*100,0) end deviasi3, 
                rpd_amount4/1000000 rpd_amount4, actual_amount4/1000000 actual_amount4, case when actual_amount4 = 0 and rpd_amount4 <> 0 then 100 when actual_amount4 <> 0 and rpd_amount4 = 0 then 100 else nvl(abs((actual_amount4-rpd_amount4)/nullif(rpd_amount4,0))*100,0) end deviasi4 
                from (
                select kdkppn,
                nvl(sum(case when minggu =1 then rpd_amount end),0) rpd_amount1,
                nvl(sum(case when minggu =1 then actual_amount end),0) actual_amount1,
                nvl(sum(case when minggu =2 then rpd_amount end),0) rpd_amount2,
                nvl(sum(case when minggu =2 then actual_amount end),0) actual_amount2,
                nvl(sum(case when minggu =3 then rpd_amount end),0) rpd_amount3,
                nvl(sum(case when minggu =3 then actual_amount end),0) actual_amount3,
                nvl(sum(case when minggu =4 then rpd_amount end),0) rpd_amount4,
                nvl(sum(case when minggu =4 then actual_amount end),0) actual_amount4
                from ".$this->_table."
                where 1=1 ";

        foreach ($filter as $filter) {
            $sql .= " AND " . $filter;
        }
        $sql .= "  group by kdkppn
                order by kdkppn
                ) a
                left join t_kppn b
                on a.kdkppn = b.kdkppn ";
        //var_dump($sql);
        $result = $this->db->select($sql);
        $data = array();
        foreach ($result as $val) {
            $d_data = new $this($this->registry);
            $d_data->set_kdkppn($val['KDKPPN']);
            $d_data->set_nmkppn($val['NMKPPN']);
            $d_data->set_rpd_1($val['RPD_AMOUNT1']);
            $d_data->set_rpd_2($val['ACTUAL_AMOUNT1']);
            $d_data->set_rpd_3($val['DEVIASI1']);
            $d_data->set_rpd_4($val['RPD_AMOUNT2']);
            $d_data->set_rpd_5($val['ACTUAL_AMOUNT2']);
            $d_data->set_rpd_6($val['DEVIASI2']);
            $d_data->set_rpd_7($val['RPD_AMOUNT3']);
            $d_data->set_rpd_8($val['ACTUAL_AMOUNT3']);
            $d_data->set_rpd_9($val['DEVIASI3']);
            $d_data->set_rpd_10($val['RPD_AMOUNT4']);
            $d_data->set_rpd_11($val['ACTUAL_AMOUNT4']);
            $d_data->set_rpd_12($val['DEVIASI4']);

            $data[] = $d_data;
        }
        return $data;
    }
    
    public function get_page4($filter,$minggu) {
        if ($minggu==1){$tambah_hari = 0;}
        elseif ($minggu==2){$tambah_hari = 7;}
        elseif ($minggu==3){$tambah_hari = 15;}
        elseif ($minggu==4){$tambah_hari = 23;}
                        $sql = "select a.kdkppn, nmkppn, 
                rpd_amount1/1000000 rpd_amount1, actual_amount1/1000000 actual_amount1, case when actual_amount1 = 0 and rpd_amount1 <>0 then 100 when actual_amount1 <> 0 and rpd_amount1 =0 then 100 else nvl(abs((actual_amount1-rpd_amount1)/nullif(rpd_amount1,0))*100,0) end deviasi1, 
                rpd_amount2/1000000 rpd_amount2, actual_amount2/1000000 actual_amount2, case when actual_amount2 = 0 and rpd_amount2 <>0 then 100 when actual_amount2 <> 0 and rpd_amount2 =0 then 100 else nvl(abs((actual_amount2-rpd_amount2)/nullif(rpd_amount2,0))*100,0) end deviasi2,
                rpd_amount3/1000000 rpd_amount3, actual_amount3/1000000 actual_amount3, case when actual_amount3 = 0 and rpd_amount3 <>0 then 100 when actual_amount3 <> 0 and rpd_amount3 =0 then 100 else nvl(abs((actual_amount3-rpd_amount3)/nullif(rpd_amount3,0))*100,0) end deviasi3, 
                rpd_amount4/1000000 rpd_amount4, actual_amount4/1000000 actual_amount4, case when actual_amount4 = 0 and rpd_amount4 <>0 then 100 when actual_amount4 <> 0 and rpd_amount4 =0 then 100 else nvl(abs((actual_amount4-rpd_amount4)/nullif(rpd_amount4,0))*100,0) end deviasi4, 
                rpd_amount5/1000000 rpd_amount5, actual_amount5/1000000 actual_amount5, case when actual_amount5 = 0 and rpd_amount5 <>0 then 100 when actual_amount5 <> 0 and rpd_amount5 =0 then 100 else nvl(abs((actual_amount5-rpd_amount5)/nullif(rpd_amount5,0))*100,0) end deviasi5, 
                rpd_amount6/1000000 rpd_amount6, actual_amount6/1000000 actual_amount6, case when actual_amount6 = 0 and rpd_amount6 <>0 then 100 when actual_amount6 <> 0 and rpd_amount6 =0 then 100 else nvl(abs((actual_amount6-rpd_amount6)/nullif(rpd_amount6,0))*100,0) end deviasi6, 
                rpd_amount7/1000000 rpd_amount7, actual_amount7/1000000 actual_amount7, case when actual_amount7 = 0 and rpd_amount7 <>0 then 100 when actual_amount7 <> 0 and rpd_amount7 =0 then 100 else nvl(abs((actual_amount7-rpd_amount7)/nullif(rpd_amount7,0))*100,0) end deviasi7, 
                rpd_amount8/1000000 rpd_amount8, actual_amount8/1000000 actual_amount8, case when actual_amount8 = 0 and rpd_amount8 <>0 then 100 when actual_amount8 <> 0 and rpd_amount8=0 then 100 else  nvl(abs((actual_amount8-rpd_amount8)/nullif(rpd_amount8,0))*100,0) end deviasi8
                from (
                select kdkppn,
                nvl(sum(case when dom= 1+".$tambah_hari." then rpd_amount end),0) rpd_amount1, nvl(sum(case when dom= 1+".$tambah_hari." then actual_amount end),0) actual_amount1, 
                nvl(sum(case when dom= 2+".$tambah_hari." then rpd_amount end),0) rpd_amount2, nvl(sum(case when dom= 2+".$tambah_hari." then actual_amount end),0) actual_amount2, 
                nvl(sum(case when dom= 3+".$tambah_hari." then rpd_amount end),0) rpd_amount3, nvl(sum(case when dom= 3+".$tambah_hari." then actual_amount end),0) actual_amount3, 
                nvl(sum(case when dom= 4+".$tambah_hari." then rpd_amount end),0) rpd_amount4, nvl(sum(case when dom= 4+".$tambah_hari." then actual_amount end),0) actual_amount4, 
                nvl(sum(case when dom= 5+".$tambah_hari." then rpd_amount end),0) rpd_amount5, nvl(sum(case when dom= 5+".$tambah_hari." then actual_amount end),0) actual_amount5, 
                nvl(sum(case when dom= 6+".$tambah_hari." then rpd_amount end),0) rpd_amount6, nvl(sum(case when dom= 6+".$tambah_hari." then actual_amount end),0) actual_amount6, 
                nvl(sum(case when dom= 7+".$tambah_hari." then rpd_amount end),0) rpd_amount7, nvl(sum(case when dom= 7+".$tambah_hari." then actual_amount end),0) actual_amount7, 
                nvl(sum(case when dom= 8+".$tambah_hari." then rpd_amount end),0) rpd_amount8, nvl(sum(case when dom= 8+".$tambah_hari." then actual_amount end),0) actual_amount8
                from ".$this->_table." 
                where 1=1 ";

        foreach ($filter as $filter) {
            $sql .= " AND " . $filter;
        }
        $sql .= "  group by kdkppn
                order by kdkppn
                ) a
                left join t_kppn b
                on a.kdkppn = b.kdkppn ";
        //var_dump($sql);
        $result = $this->db->select($sql);
        $data = array();
        foreach ($result as $val) {
            $d_data = new $this($this->registry);
            $d_data->set_kdkppn($val['KDKPPN']);
            $d_data->set_nmkppn($val['NMKPPN']);
            $d_data->set_rpd_1($val['RPD_AMOUNT1']);
            $d_data->set_rpd_2($val['ACTUAL_AMOUNT1']);
            $d_data->set_rpd_3($val['DEVIASI1']);
            $d_data->set_rpd_4($val['RPD_AMOUNT2']);
            $d_data->set_rpd_5($val['ACTUAL_AMOUNT2']);
            $d_data->set_rpd_6($val['DEVIASI2']);
            $d_data->set_rpd_7($val['RPD_AMOUNT3']);
            $d_data->set_rpd_8($val['ACTUAL_AMOUNT3']);
            $d_data->set_rpd_9($val['DEVIASI3']);
            $d_data->set_rpd_10($val['RPD_AMOUNT4']);
            $d_data->set_rpd_11($val['ACTUAL_AMOUNT4']);
            $d_data->set_rpd_12($val['DEVIASI4']);
            $d_data->set_rpd_13($val['RPD_AMOUNT5']);
            $d_data->set_rpd_14($val['ACTUAL_AMOUNT5']);
            $d_data->set_rpd_15($val['DEVIASI5']);
            $d_data->set_rpd_16($val['RPD_AMOUNT6']);
            $d_data->set_rpd_17($val['ACTUAL_AMOUNT6']);
            $d_data->set_rpd_18($val['DEVIASI6']);
            $d_data->set_rpd_19($val['RPD_AMOUNT7']);
            $d_data->set_rpd_20($val['ACTUAL_AMOUNT7']);
            $d_data->set_rpd_21($val['DEVIASI7']);
            $d_data->set_rpd_22($val['RPD_AMOUNT8']);
            $d_data->set_rpd_23($val['ACTUAL_AMOUNT8']);
            $d_data->set_rpd_24($val['DEVIASI8']);

            $data[] = $d_data;
        }
        return $data;
    }
    
    public function get_page5($filter) {
        $sql = "select kdsatker, nmsatker,
                case when deviasi1 > 100 then 100 when deviasi1 is null then  null else deviasi1 end deviasi1, 
                case when deviasi2 > 100 then 100 when deviasi2 is null then null else deviasi2 end deviasi2, 
                case when deviasi3 > 100 then 100 when deviasi3 is null then null  else deviasi3 end deviasi3, 
                case when deviasi4 > 100 then 100 when deviasi4 is null then null  else deviasi4 end deviasi4, 
                case when deviasi5 > 100 then 100 when deviasi5 is null then null  else deviasi5 end deviasi5,
                 case when deviasi6 > 100 then 100 when deviasi6 is null then null  else deviasi6 end deviasi6, 
                 case when deviasi7 > 100 then 100 when deviasi7 is null then null  else deviasi7 end deviasi7, 
                 case when deviasi8 > 100 then 100 when deviasi8 is null then null  else deviasi8 end deviasi8, 
                 case when deviasi9 > 100 then 100 when deviasi9 is null then null  else deviasi9 end deviasi9, 
                 case when deviasi10 > 100 then 100 when deviasi10 is null then null  else deviasi10 end deviasi10 , 
                 case when deviasi11 > 100 then 100 when deviasi11 is null then null  else deviasi11 end deviasi11, 
                 case when deviasi12 > 100 then 100 when deviasi12 is null then null  else deviasi12 end deviasi12 , 
                 case when deviasi13 > 100 then 100 when deviasi13 is null then null  else deviasi13 end deviasi13 , 
                 case when deviasi14 > 100 then 100 when deviasi14 is null then null  else deviasi14 end deviasi14 , 
                 case when deviasi15 > 100 then 100 when deviasi15 is null then null  else deviasi15 end deviasi15 , 
                 case when deviasi16 > 100 then 100 when deviasi16 is null then null  else deviasi16 end deviasi16 , 
                 case when deviasi17 > 100 then 100 when deviasi17 is null then null  else deviasi17 end deviasi17 , 
                 case when deviasi18 > 100 then 100 when deviasi18 is null then null  else deviasi18 end deviasi18 , 
                 case when deviasi19 > 100 then 100 when deviasi19 is null then null  else deviasi19 end deviasi19 , 
                 case when deviasi20 > 100 then 100 when deviasi20 is null then null  else deviasi20 end deviasi20 , 
                 case when deviasi21 > 100 then 100 when deviasi21 is null then null  else deviasi21 end deviasi21 , 
                 case when deviasi22 > 100 then 100 when deviasi22 is null then null  else deviasi22 end deviasi22 , 
                 case when deviasi23 > 100 then 100 when deviasi23 is null then null  else deviasi23 end deviasi23 , 
                 case when deviasi24 > 100 then 100 when deviasi24 is null then null  else deviasi24 end deviasi24 , 
                 case when deviasi25 > 100 then 100 when deviasi25 is null then null  else deviasi25 end deviasi25 , 
                 case when deviasi26 > 100 then 100 when deviasi26 is null then null  else deviasi26 end deviasi26 , 
                 case when deviasi27 > 100 then 100 when deviasi27 is null then null  else deviasi27 end deviasi27 , 
                 case when deviasi28 > 100 then 100 when deviasi28 is null then null  else deviasi28 end deviasi28 , 
                 case when deviasi29 > 100 then 100 when deviasi29 is null then null  else deviasi29 end deviasi29 , 
                 case when deviasi30 > 100 then 100 when deviasi30 is null then null  else deviasi30 end deviasi30 , 
                 case when deviasi31 > 100 then 100 when deviasi31 is null then null  else deviasi31 end deviasi31 
                from ( select a.kdsatker, nmsatker, 
                sum(case when dom =1 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi1,
                sum(case when dom =2 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi2,
                sum(case when dom =3 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi3,
                sum(case when dom =4 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi4,
                sum(case when dom =5 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi5,
                sum(case when dom =6 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi6,
                sum(case when dom =7 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi7,
                sum(case when dom =8 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi8,
                sum(case when dom =9 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi9,
                sum(case when dom =10 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi10,
                sum(case when dom =11 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi11,
                sum(case when dom =12 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi12,
                sum(case when dom =13 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi13,
                sum(case when dom =14 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi14,
                sum(case when dom =15 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi15,
                sum(case when dom =16 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi16,
                sum(case when dom =17 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi17,
                sum(case when dom =18 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi18,
                sum(case when dom =19 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi19,
                sum(case when dom =20 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi20,
                sum(case when dom =21 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi21,
                sum(case when dom =22 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi22,
                sum(case when dom =23 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi23,
                sum(case when dom =24 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi24,
                sum(case when dom =25 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi25,
                sum(case when dom =26 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi26,
                sum(case when dom =27 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi27,
                sum(case when dom =28 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi28,
                sum(case when dom =29 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi29,
                sum(case when dom =30 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi30,
                sum(case when dom =31 then nvl(abs((actual_amount-rpd_amount)/nullif(rpd_amount,0))*100,0) end) deviasi31
                from ".$this->_table." a 
                left join t_satker b
                on a.kdsatker = b.kdsatker
                where 1=1 ";

        foreach ($filter as $filter) {
            $sql .= " AND " . $filter;
        }
        $sql .= "  group by a.kdsatker, nmsatker
                order by a.kdsatker )";
        //var_dump($sql);
        $result = $this->db->select($sql);
        $data = array();
        foreach ($result as $val) {
            $d_data = new $this($this->registry);
            $d_data->set_kdsatker($val['KDSATKER']);
            $d_data->set_nmsatker($val['NMSATKER']);
            $d_data->set_rpd_1($val['DEVIASI1']);
            $d_data->set_rpd_2($val['DEVIASI2']);
            $d_data->set_rpd_3($val['DEVIASI3']);
            $d_data->set_rpd_4($val['DEVIASI4']);
            $d_data->set_rpd_5($val['DEVIASI5']);
            $d_data->set_rpd_6($val['DEVIASI6']);
            $d_data->set_rpd_7($val['DEVIASI7']);
            $d_data->set_rpd_8($val['DEVIASI8']);
            $d_data->set_rpd_9($val['DEVIASI9']);
            $d_data->set_rpd_10($val['DEVIASI10']);
            $d_data->set_rpd_11($val['DEVIASI11']);
            $d_data->set_rpd_12($val['DEVIASI12']);
            $d_data->set_rpd_13($val['DEVIASI13']);
            $d_data->set_rpd_14($val['DEVIASI14']);
            $d_data->set_rpd_15($val['DEVIASI15']);
            $d_data->set_rpd_16($val['DEVIASI16']);
            $d_data->set_rpd_17($val['DEVIASI17']);
            $d_data->set_rpd_18($val['DEVIASI18']);
            $d_data->set_rpd_19($val['DEVIASI19']);
            $d_data->set_rpd_20($val['DEVIASI20']);
            $d_data->set_rpd_21($val['DEVIASI21']);
            $d_data->set_rpd_22($val['DEVIASI22']);
            $d_data->set_rpd_23($val['DEVIASI23']);
            $d_data->set_rpd_24($val['DEVIASI24']);
            $d_data->set_rpd_25($val['DEVIASI25']);
            $d_data->set_rpd_26($val['DEVIASI26']);
            $d_data->set_rpd_27($val['DEVIASI27']);
            $d_data->set_rpd_28($val['DEVIASI28']);
            $d_data->set_rpd_29($val['DEVIASI29']);
            $d_data->set_rpd_30($val['DEVIASI30']);
            $d_data->set_rpd_31($val['DEVIASI31']);
            $data[] = $d_data;
        }
        return $data;
    }

    public function get_monitoring_rpd_bulan($filter) {
        $sql = "SELECT *
				FROM "
                . $this->_table1 . "
				WHERE 
				1=1 AND TAHUN = '".Session::get('ta')."'"

        ;
        $no = 0;
        foreach ($filter as $filter) {
            $sql .= " AND " . $filter;
        }
        $sql .= " ORDER BY BULAN, KDKPPN ";
        //var_dump ($sql);
        $result = $this->db->select($sql);
        $data = array();
        foreach ($result as $val) {
            $d_data = new $this($this->registry);
            $d_data->set_kdkppn($val['KDKPPN']);
            //$d_data->set_nama_kppn($val['NAMA_KPPN']);
            $d_data->set_tahun($val['TAHUN']);
            $d_data->set_bulan($val['BULAN']);
            $d_data->set_sts01($val['STS01']);
            $d_data->set_sts02($val['STS02']);
            $d_data->set_sts03($val['STS03']);
            $d_data->set_sts04($val['STS04']);
            $d_data->set_sts05($val['STS05']);
            $d_data->set_sts06($val['STS06']);
            $d_data->set_sts07($val['STS07']);
            $d_data->set_sts08($val['STS08']);
            $d_data->set_sts09($val['STS09']);
            $d_data->set_sts10($val['STS10']);
            $d_data->set_sts11($val['STS11']);
            $d_data->set_sts12($val['STS12']);
            $d_data->set_sts13($val['STS13']);
            $d_data->set_sts14($val['STS14']);
            $d_data->set_sts15($val['STS15']);
            $d_data->set_sts16($val['STS16']);
            $d_data->set_sts17($val['STS17']);
            $d_data->set_sts18($val['STS18']);
            $d_data->set_sts19($val['STS19']);
            $d_data->set_sts20($val['STS20']);
            $d_data->set_sts21($val['STS21']);
            $d_data->set_sts22($val['STS22']);
            $d_data->set_sts23($val['STS23']);
            $d_data->set_sts24($val['STS24']);
            $d_data->set_sts25($val['STS25']);
            $d_data->set_sts26($val['STS26']);
            $d_data->set_sts27($val['STS27']);
            $d_data->set_sts28($val['STS28']);
            $d_data->set_sts29($val['STS29']);
            $d_data->set_sts30($val['STS30']);
            $d_data->set_sts31($val['STS31']);
            $d_data->set_rpd_1($val['RPD01']);
            $d_data->set_rpd_2($val['RPD02']);
            $d_data->set_rpd_3($val['RPD03']);
            $d_data->set_rpd_4($val['RPD04']);
            $d_data->set_rpd_5($val['RPD05']);
            $d_data->set_rpd_6($val['RPD06']);
            $d_data->set_rpd_7($val['RPD07']);
            $d_data->set_rpd_8($val['RPD08']);
            $d_data->set_rpd_9($val['RPD09']);
            $d_data->set_rpd_10($val['RPD10']);
            $d_data->set_rpd_11($val['RPD11']);
            $d_data->set_rpd_12($val['RPD12']);
            $d_data->set_rpd_13($val['RPD13']);
            $d_data->set_rpd_14($val['RPD14']);
            $d_data->set_rpd_15($val['RPD15']);
            $d_data->set_rpd_16($val['RPD16']);
            $d_data->set_rpd_17($val['RPD17']);
            $d_data->set_rpd_18($val['RPD18']);
            $d_data->set_rpd_19($val['RPD19']);
            $d_data->set_rpd_20($val['RPD20']);
            $d_data->set_rpd_21($val['RPD21']);
            $d_data->set_rpd_22($val['RPD22']);
            $d_data->set_rpd_23($val['RPD23']);
            $d_data->set_rpd_24($val['RPD24']);
            $d_data->set_rpd_25($val['RPD25']);
            $d_data->set_rpd_26($val['RPD26']);
            $d_data->set_rpd_27($val['RPD27']);
            $d_data->set_rpd_28($val['RPD28']);
            $d_data->set_rpd_29($val['RPD29']);
            $d_data->set_rpd_30($val['RPD30']);
            $d_data->set_rpd_31($val['RPD31']);
            $data[] = $d_data;
        }
        return $data;
    }
    
    public function get_rpd_satker($filter) {
        $sql = "select dom, akun, sum(rpd_amount) rpd_amount, sum(actual_amount) actual_amount, avg(deviasi) deviasi
                from ".$this->_table." 
                where 1=1 ";

        foreach ($filter as $filter) {
            $sql .= " AND " . $filter;
        }
        $sql .= " group by dom,akun
                order by dom,akun ";
        //var_dump($sql);
        $result = $this->db->select($sql);
        $data = array();
        foreach ($result as $val) {
            $d_data = new $this($this->registry);
            $d_data->set_dom($val['DOM']);
            $d_data->set_akun($val['AKUN']);
            $d_data->set_rpd_1($val['RPD_AMOUNT']/1000000);
            $d_data->set_rpd_2($val['ACTUAL_AMOUNT']/1000000);
            $d_data->set_rpd_3($val['DEVIASI']);
            $data[] = $d_data;
        }
        return $data;
    }
    
    public function get_akun_satker($filter) {
        $sql = "select akun 
                from ".$this->_table." 
                where 1=1 and akun > 40";

        foreach ($filter as $filter) {
            $sql .= " AND " . $filter;
        }
        $sql .= " group by akun
                order by akun ";
        //var_dump($sql);
        $result = $this->db->select($sql);
        $data = array();
        foreach ($result as $val) {
            $d_data = new $this($this->registry);
            $d_data->set_akun($val['AKUN']);

            $data[] = $d_data;
        }
        return $data;
    }
    
    public function get_dom_satker($filter) {
        $sql = "select dom 
                from ".$this->_table." 
                where 1=1 ";

        foreach ($filter as $filter) {
            $sql .= " AND " . $filter;
        }
        $sql .= " group by dom
                order by dom ";
        //var_dump($sql);
        $result = $this->db->select($sql);
        $data = array();
        foreach ($result as $val) {
            $d_data = new $this($this->registry);
            $d_data->set_dom($val['DOM']);

            $data[] = $d_data;
        }
        return $data;
    }
    
    public function get_rpd_kppn($filter) {
        $sql = "select * 
                from ".$this->_table."_kppn_pvt
                where 1=1 ";

        foreach ($filter as $filter) {
            $sql .= " AND " . $filter;
        }
        $sql .= " order by kdsatker ";
        //var_dump($sql);
        $result = $this->db->select($sql);
        $data = array();
        foreach ($result as $val) {
            $d_data = new $this($this->registry);
            $d_data->set_kdsatker($val['KDSATKER']);
            $d_data->set_nmsatker($val['NMSATKER']);
            $d_data->set_rpd_1($val['DEVIASI1']);
            $d_data->set_rpd_2($val['DEVIASI2']);
            $d_data->set_rpd_3($val['DEVIASI3']);
            $d_data->set_rpd_4($val['DEVIASI4']);
            $d_data->set_rpd_5($val['DEVIASI5']);
            $d_data->set_rpd_6($val['DEVIASI6']);
            $d_data->set_rpd_7($val['DEVIASI7']);
            $d_data->set_rpd_8($val['DEVIASI8']);
            $d_data->set_rpd_9($val['DEVIASI9']);
            $d_data->set_rpd_10($val['DEVIASI10']);
            $d_data->set_rpd_11($val['DEVIASI11']);
            $d_data->set_rpd_12($val['DEVIASI12']);
            $d_data->set_rpd_13($val['DEVIASI13']);
            $d_data->set_rpd_14($val['DEVIASI14']);
            $d_data->set_rpd_15($val['DEVIASI15']);
            $d_data->set_rpd_16($val['DEVIASI16']);
            $d_data->set_rpd_17($val['DEVIASI17']);
            $d_data->set_rpd_18($val['DEVIASI18']);
            $d_data->set_rpd_19($val['DEVIASI19']);
            $d_data->set_rpd_20($val['DEVIASI20']);
            $d_data->set_rpd_21($val['DEVIASI21']);
            $d_data->set_rpd_22($val['DEVIASI22']);
            $d_data->set_rpd_23($val['DEVIASI23']);
            $d_data->set_rpd_24($val['DEVIASI24']);
            $d_data->set_rpd_25($val['DEVIASI25']);
            $d_data->set_rpd_26($val['DEVIASI26']);
            $d_data->set_rpd_27($val['DEVIASI27']);
            $d_data->set_rpd_28($val['DEVIASI28']);
            $d_data->set_rpd_29($val['DEVIASI29']);
            $d_data->set_rpd_30($val['DEVIASI30']);
            $d_data->set_rpd_31($val['DEVIASI31']);
            $data[] = $d_data;
        }
        return $data;
    }
    
    public function get_rpd_kanwil($filter) {
        $sql = "select * 
                from ".$this->_table."_kanwil_pvt
                where 1=1 ";

        foreach ($filter as $filter) {
            $sql .= " AND " . $filter;
        }
        $sql .= " order by kdkppn ";
        //var_dump($sql);
        $result = $this->db->select($sql);
        $data = array();
        foreach ($result as $val) {
            $d_data = new $this($this->registry);
            $d_data->set_kdkppn($val['KDKPPN']);
            $d_data->set_nmkppn($val['NMKPPN']);
            $d_data->set_rpd_1($val['DEVIASI1']);
            $d_data->set_rpd_2($val['DEVIASI2']);
            $d_data->set_rpd_3($val['DEVIASI3']);
            $d_data->set_rpd_4($val['DEVIASI4']);
            $d_data->set_rpd_5($val['DEVIASI5']);
            $d_data->set_rpd_6($val['DEVIASI6']);
            $d_data->set_rpd_7($val['DEVIASI7']);
            $d_data->set_rpd_8($val['DEVIASI8']);
            $d_data->set_rpd_9($val['DEVIASI9']);
            $d_data->set_rpd_10($val['DEVIASI10']);
            $d_data->set_rpd_11($val['DEVIASI11']);
            $d_data->set_rpd_12($val['DEVIASI12']);
            $d_data->set_rpd_13($val['DEVIASI13']);
            $d_data->set_rpd_14($val['DEVIASI14']);
            $d_data->set_rpd_15($val['DEVIASI15']);
            $d_data->set_rpd_16($val['DEVIASI16']);
            $d_data->set_rpd_17($val['DEVIASI17']);
            $d_data->set_rpd_18($val['DEVIASI18']);
            $d_data->set_rpd_19($val['DEVIASI19']);
            $d_data->set_rpd_20($val['DEVIASI20']);
            $d_data->set_rpd_21($val['DEVIASI21']);
            $d_data->set_rpd_22($val['DEVIASI22']);
            $d_data->set_rpd_23($val['DEVIASI23']);
            $d_data->set_rpd_24($val['DEVIASI24']);
            $d_data->set_rpd_25($val['DEVIASI25']);
            $d_data->set_rpd_26($val['DEVIASI26']);
            $d_data->set_rpd_27($val['DEVIASI27']);
            $d_data->set_rpd_28($val['DEVIASI28']);
            $d_data->set_rpd_29($val['DEVIASI29']);
            $d_data->set_rpd_30($val['DEVIASI30']);
            $d_data->set_rpd_31($val['DEVIASI31']);
            $data[] = $d_data;
        }
        return $data;
    }
    
    /*
     * setter
     */

    public function set_kdkanwil ($kdkanwil) {
        $this->_kdkanwil = $kdkanwil;
    }

    public function set_nmkanwil ($nmkanwil) {
        $this->_nmkanwil = $nmkanwil;
    }

    public function set_kdkppn ($kdkppn) {
        $this->_kdkppn = $kdkppn;
    }

    public function set_nmkppn ($nmkppn) {
        $this->_nmkppn = $nmkppn;
    }

    public function set_kdsatker ($kdsatker) {
        $this->_kdsatker = $kdsatker;
    }

    public function set_nmsatker ($nmsatker) {
        $this->_nmsatker = $nmsatker;
    }

    public function set_akun ($akun) {
        $this->_akun = $akun;
    }

    public function set_nmakun ($nmakun) {
        $this->_nmakun = $nmakun;
    }

    public function set_minggu ($minggu) {
        $this->_minggu = $minggu;
    }

    public function set_bulan ($bulan) {
        $this->_bulan = $bulan;
    }

    public function set_tahun ($tahun) {
        $this->_tahun = $tahun;
    }

    public function set_dom ($dow) {
        $this->_dom = $dow;
    }

    public function set_rpd_1 ($rpd_1) {
        $this->_rpd_1 = $rpd_1;
    }

    public function set_rpd_2 ($rpd_2) {
        $this->_rpd_2 = $rpd_2;
    }

    public function set_rpd_3 ($rpd_3) {
        $this->_rpd_3 = $rpd_3;
    }

    public function set_rpd_4 ($rpd_4) {
        $this->_rpd_4 = $rpd_4;
    }

    public function set_rpd_5 ($rpd_5) {
        $this->_rpd_5 = $rpd_5;
    }

    public function set_rpd_6 ($rpd_6) {
        $this->_rpd_6 = $rpd_6;
    }

    public function set_rpd_7 ($rpd_7) {
        $this->_rpd_7 = $rpd_7;
    }

    public function set_rpd_8 ($rpd_8) {
        $this->_rpd_8 = $rpd_8;
    }

    public function set_rpd_9 ($rpd_9) {
        $this->_rpd_9 = $rpd_9;
    }

    public function set_rpd_10 ($rpd_10) {
        $this->_rpd_10 = $rpd_10;
    }

    public function set_rpd_11 ($rpd_11) {
        $this->_rpd_11 = $rpd_11;
    }

    public function set_rpd_12 ($rpd_12) {
        $this->_rpd_12 = $rpd_12;
    }

    public function set_rpd_13 ($rpd_13) {
        $this->_rpd_13 = $rpd_13;
    }

    public function set_rpd_14 ($rpd_14) {
        $this->_rpd_14 = $rpd_14;
    }

    public function set_rpd_15 ($rpd_15) {
        $this->_rpd_15 = $rpd_15;
    }

    public function set_rpd_16 ($rpd_16) {
        $this->_rpd_16 = $rpd_16;
    }

    public function set_rpd_17 ($rpd_17) {
        $this->_rpd_17 = $rpd_17;
    }

    public function set_rpd_18 ($rpd_18) {
        $this->_rpd_18 = $rpd_18;
    }

    public function set_rpd_19 ($rpd_19) {
        $this->_rpd_19 = $rpd_19;
    }

    public function set_rpd_20 ($rpd_20) {
        $this->_rpd_20 = $rpd_20;
    }

    public function set_rpd_21 ($rpd_21) {
        $this->_rpd_21 = $rpd_21;
    }

    public function set_rpd_22 ($rpd_22) {
        $this->_rpd_22 = $rpd_22;
    }

    public function set_rpd_23 ($rpd_23) {
        $this->_rpd_23 = $rpd_23;
    }

    public function set_rpd_24 ($rpd_24) {
        $this->_rpd_24 = $rpd_24;
    }

    public function set_rpd_25 ($rpd_25) {
        $this->_rpd_25 = $rpd_25;
    }

    public function set_rpd_26 ($rpd_26) {
        $this->_rpd_26 = $rpd_26;
    }

    public function set_rpd_27 ($rpd_27) {
        $this->_rpd_27 = $rpd_27;
    }

    public function set_rpd_28 ($rpd_28) {
        $this->_rpd_28 = $rpd_28;
    }

    public function set_rpd_29 ($rpd_29) {
        $this->_rpd_29 = $rpd_29;
    }

    public function set_rpd_30 ($rpd_30) {
        $this->_rpd_30 = $rpd_30;
    }

    public function set_rpd_31 ($rpd_31) {
        $this->_rpd_31 = $rpd_31;
    }

    public function set_sts01($sts01) {
        $this->_sts01 = $sts01;
    }

    public function set_sts02($sts02) {
        $this->_sts02 = $sts02;
    }

    public function set_sts03($sts03) {
        $this->_sts03 = $sts03;
    }

    public function set_sts04($sts04) {
        $this->_sts04 = $sts04;
    }

    public function set_sts05($sts05) {
        $this->_sts05 = $sts05;
    }

    public function set_sts06($sts06) {
        $this->_sts06 = $sts06;
    }

    public function set_sts07($sts07) {
        $this->_sts07 = $sts07;
    }

    public function set_sts08($sts08) {
        $this->_sts08 = $sts08;
    }

    public function set_sts09($sts09) {
        $this->_sts09 = $sts09;
    }

    public function set_sts10($sts10) {
        $this->_sts10 = $sts10;
    }

    public function set_sts11($sts11) {
        $this->_sts11 = $sts11;
    }

    public function set_sts12($sts12) {
        $this->_sts12 = $sts12;
    }

    public function set_sts13($sts13) {
        $this->_sts13 = $sts13;
    }

    public function set_sts14($sts14) {
        $this->_sts14 = $sts14;
    }

    public function set_sts15($sts15) {
        $this->_sts15 = $sts15;
    }

    public function set_sts16($sts16) {
        $this->_sts16 = $sts16;
    }

    public function set_sts17($sts17) {
        $this->_sts17 = $sts17;
    }

    public function set_sts18($sts18) {
        $this->_sts18 = $sts18;
    }

    public function set_sts19($sts19) {
        $this->_sts19 = $sts19;
    }

    public function set_sts20($sts20) {
        $this->_sts20 = $sts20;
    }

    public function set_sts21($sts21) {
        $this->_sts21 = $sts21;
    }

    public function set_sts22($sts22) {
        $this->_sts22 = $sts22;
    }

    public function set_sts23($sts23) {
        $this->_sts23 = $sts23;
    }

    public function set_sts24($sts24) {
        $this->_sts24 = $sts24;
    }

    public function set_sts25($sts25) {
        $this->_sts25 = $sts25;
    }

    public function set_sts26($sts26) {
        $this->_sts26 = $sts26;
    }

    public function set_sts27($sts27) {
        $this->_sts27 = $sts27;
    }

    public function set_sts28($sts28) {
        $this->_sts28 = $sts28;
    }

    public function set_sts29($sts29) {
        $this->_sts29 = $sts29;
    }

    public function set_sts30($sts30) {
        $this->_sts30 = $sts30;
    }

    public function set_sts31($sts31) {
        $this->_sts31 = $sts31;
    }

    public function set_table ($table) {
        $this->_table = $table;
    }

    /*
     * getter
     */

    public function get_kdkanwil() {
        return $this->_kdkanwil;
    }

    public function get_nmkanwil() {
        return $this->_nmkanwil;
    }

    public function get_kdkppn() {
        return $this->_kdkppn;
    }

    public function get_nmkppn() {
        return $this->_nmkppn;
    }

    public function get_kdsatker() {
        return $this->_kdsatker;
    }

    public function get_nmsatker() {
        return $this->_nmsatker;
    }

    public function get_akun() {
        return $this->_akun;
    }

    public function get_nmakun() {
        return $this->_nmakun;
    }

    public function get_minggu() {
        return $this->_minggu;
    }

    public function get_bulan() {
        return $this->_bulan;
    }

    public function get_tahun() {
        return $this->_tahun;
    }

    public function get_dom() {
        return $this->_dom;
    }

    public function get_rpd_1() {
        return $this->_rpd_1;
    }

    public function get_rpd_2() {
        return $this->_rpd_2;
    }

    public function get_rpd_3() {
        return $this->_rpd_3;
    }

    public function get_rpd_4() {
        return $this->_rpd_4;
    }

    public function get_rpd_5() {
        return $this->_rpd_5;
    }

    public function get_rpd_6() {
        return $this->_rpd_6;
    }

    public function get_rpd_7() {
        return $this->_rpd_7;
    }

    public function get_rpd_8() {
        return $this->_rpd_8;
    }

    public function get_rpd_9() {
        return $this->_rpd_9;
    }

    public function get_rpd_10() {
        return $this->_rpd_10;
    }

    public function get_rpd_11() {
        return $this->_rpd_11;
    }

    public function get_rpd_12() {
        return $this->_rpd_12;
    }

    public function get_rpd_13() {
        return $this->_rpd_13;
    }

    public function get_rpd_14() {
        return $this->_rpd_14;
    }

    public function get_rpd_15() {
        return $this->_rpd_15;
    }

    public function get_rpd_16() {
        return $this->_rpd_16;
    }

    public function get_rpd_17() {
        return $this->_rpd_17;
    }

    public function get_rpd_18() {
        return $this->_rpd_18;
    }

    public function get_rpd_19() {
        return $this->_rpd_19;
    }

    public function get_rpd_20() {
        return $this->_rpd_20;
    }

    public function get_rpd_21() {
        return $this->_rpd_21;
    }

    public function get_rpd_22() {
        return $this->_rpd_22;
    }

    public function get_rpd_23() {
        return $this->_rpd_23;
    }

    public function get_rpd_24() {
        return $this->_rpd_24;
    }

    public function get_rpd_25() {
        return $this->_rpd_25;
    }

    public function get_rpd_26() {
        return $this->_rpd_26;
    }

    public function get_rpd_27() {
        return $this->_rpd_27;
    }

    public function get_rpd_28() {
        return $this->_rpd_28;
    }

    public function get_rpd_29() {
        return $this->_rpd_29;
    }

    public function get_rpd_30() {
        return $this->_rpd_30;
    }

    public function get_rpd_31() {
        return $this->_rpd_31;
    }

    public function get_sts01() {
        return $this->_sts01;
    }

    public function get_sts02() {
        return $this->_sts02;
    }

    public function get_sts03() {
        return $this->_sts03;
    }

    public function get_sts04() {
        return $this->_sts04;
    }

    public function get_sts05() {
        return $this->_sts05;
    }

    public function get_sts06() {
        return $this->_sts06;
    }

    public function get_sts07() {
        return $this->_sts07;
    }

    public function get_sts08() {
        return $this->_sts08;
    }

    public function get_sts09() {
        return $this->_sts09;
    }

    public function get_sts10() {
        return $this->_sts10;
    }

    public function get_sts11() {
        return $this->_sts11;
    }

    public function get_sts12() {
        return $this->_sts12;
    }

    public function get_sts13() {
        return $this->_sts13;
    }

    public function get_sts14() {
        return $this->_sts14;
    }

    public function get_sts15() {
        return $this->_sts15;
    }

    public function get_sts16() {
        return $this->_sts16;
    }

    public function get_sts17() {
        return $this->_sts17;
    }

    public function get_sts18() {
        return $this->_sts18;
    }

    public function get_sts19() {
        return $this->_sts19;
    }

    public function get_sts20() {
        return $this->_sts20;
    }

    public function get_sts21() {
        return $this->_sts21;
    }

    public function get_sts22() {
        return $this->_sts22;
    }

    public function get_sts23() {
        return $this->_sts23;
    }

    public function get_sts24() {
        return $this->_sts24;
    }

    public function get_sts25() {
        return $this->_sts25;
    }

    public function get_sts26() {
        return $this->_sts26;
    }

    public function get_sts27() {
        return $this->_sts27;
    }

    public function get_sts28() {
        return $this->_sts28;
    }

    public function get_sts29() {
        return $this->_sts29;
    }

    public function get_sts30() {
        return $this->_sts30;
    }

    public function get_sts31() {
        return $this->_sts31;
    }

    public function get_table() {
        return $this->_table;
    }

    public function get_table1() {
        return $this->_table1;
    }
    
    
    
    /*
     * destruktor
     */

    public function __destruct() {
        
    }

}
    
